package com.tansun.easycare.rule.ruletest.entity;

import java.util.Date;

import com.jeedev.msdp.base.entity.SysUser;
import com.tansun.easycare.modules.sys.utils.UserUtils;
import com.tansun.easycare.rule.common.entity.RuleBaseEntity;
import com.tansun.rule.common.RuleModelTypeEnum;

import lombok.Data;

/**
 * 规则测试Entity
 *
 * @author lixs
 * @version 2017-03-22
 */
@Data
public class RuleTest extends RuleBaseEntity<RuleTest> {

    private static final long serialVersionUID = 1L;
    
    public  static  final  String  RULE_GROUP_TEST ="/ruleTest/rulegroup/result";
    private String testName;        // 测试名称
    private String modelCode;        // 模型编号
    private String status;        // 状态
    private String tracks;        // 轨迹
    private String version;        // 版本
    private String modelType;        // 模型类型
    private String modelTypeName;
    private String projectCode;        // 项目编号
    private String testType;
    private String ruleName;
    private String modifiedBy;
    private String creater;
    private String testDataVersion;//测试数据版本
    private String testClassify;//对比测试测试类型
    private Date beginDate;
    private Date endDate;
    private  String  formatType;
 

    public static final String UPDATE_BASE_PATH = "/ruleTest/batchTest/update";

    public static final String RUSULT_EXT = "/ruleTest/batchTest/result";
    
    

    public RuleTest() {
        super();
    }

    public RuleTest(String id) {
        super(id);
    }

    public String getModifiedBy() {
        if (this.modifiedBy != null) {
        	SysUser u = UserUtils.getSysService().getUserById(this.modifiedBy);
        	if(u!=null)
        		modifiedBy = u.getLoginName();
        }
        return modifiedBy;
    }
    public String getCreater() {
        if (this.creater != null) {
        	SysUser u = UserUtils.getSysService().getUserById(this.creater);
        	if(u!=null)
        		creater = u.getLoginName();
        }
        return creater;
    }
    
   
    public String getModelTypeName() {
        if (modelType != null) {
            this.modelTypeName = RuleModelTypeEnum.getName(this.modelType);
        }
        return modelTypeName;
    }
   
    public String getBaseUpdatePath() {
        return RuleTest.UPDATE_BASE_PATH;
    }
    public String getResultPath() {
        return RuleTest.RUSULT_EXT;
    }


}